﻿@model Critex.ViewModels.DashboardUploadImageViewModel
@{
    ViewBag.Title = "Upload images";
    Layout = "Shared/_DashboardLayout.cshtml";

    var areaId = Model.ExistingArea == null ? -1 : Model.ExistingArea.Id;
    var collectionId = Model.TargetCollection == null ? -1 : Model.TargetCollection.Id;
    var sectionId = Model.SectionId;
}

<h2>Upload images</h2>
<p>Upload the images that you want to add. The maximum file size for images is 3 megabytes. It is preferred that you upload files in JPEG (.JPG) format although most filetypes are supported.</p>

@using (Html.BeginForm("UploadImage", "Dashboard", FormMethod.Post, new { enctype = "multipart/form-data" }))
{

    @Html.Hidden("areaId", areaId);
    @Html.Hidden("collectionId", collectionId);
    @Html.Hidden("sectionId", sectionId);
    
    <h3>Specify file</h3>
    
    <input type="file" name="file" />
    
    <h3>Describe the image</h3>
    
    <h4>Short description</h4>
    <p>The short description is shown when a user hovers his mouse over an image (as a tooltip).</p>
    <label for="shortDescription">Short description</label>
    <input type="text" name="shortDescription" value="@Model.ShortDescription"/>
    
    <h4>Long description</h4>
    <p>The long description is shown in the bottom of the image on the slide-show of the gallery page.</p>
    <div class="htmlArea">
        @Html.EditorFor(model => model.LongDescription, null, "longDescription", new { StyleLocation = Model.StyleLocation })
    </div>
    
    <h3>Upload the image</h3>
    
    <input type="submit" value="Upload" />

}